package com.liang.mybatis01;

import com.liang.mybatis01.mapper.UserMapper;
import com.liang.mybatis01.pojo.User;
import com.liang.mybatis01.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class MybatisTest2 {
    public static void main(String[] args) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        List<User> list = mapper.getUserByCode("z");
        for (User user : list) {
            System.out.println(user);
        }
        sqlSession.close();
    }
}
